package team.szm.scd.database.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import team.szm.scd.database.entity.Medicine;
import team.szm.scd.database.vo.MedicineVO;

import java.util.List;

@Repository
public interface MedicineMapper extends BaseMapper<Medicine> {
    @Select("select mid as id, `count` as 'count', mname as name, price \n" +
            "from medicine natural join mdc_case_have \n" +
            "where cid = ${caseId}")
    List<MedicineVO> fromCaseId(@Param("caseId") String caseId);
}
